{{template "header.html" .}}
<link rel="stylesheet" href="/assets/js/plugins/pagination/pagination.css" />
<link href="/assets/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <h2>团队成员</h2>
                    <p>当前加入你的团队的所有用户,待激活用户需要审核后才能访问团队下的项目</p>
                    <div class="row">
                        <div class="col-sm-2">
                            <select name="usergroup" class="input-sm form-control input-s-sm inline">
                                <option value="0">用户权限组</option>
                                {{range .group}}
                                    <option value="{{.Groupid}}">{{.Groupname}}</option>
                                {{end}}
                                {{$le:= len .group}}
                                {{if eq $le 0}}
                                    <input type="hidden" name="nogroup" value="1">
                                {{end}}
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <select name="userstatus" class="input-sm form-control input-s-sm inline">
                                <option value="0">用户状态</option>
                                {{range $k, $v :=.userStatus}}
                                    <option value="{{$k}}">{{$v}}</option>
                                {{end}}
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <input type="text" name="keyword" placeholder="用户名/手机号/邮箱" class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="button" class="btn btn btn-primary search"> <i class="fa fa-search"></i> 搜索</button>
                                    </span>

                            </div>
                        </div>
                    </div>
                    <div class="clients-list">
                        <ul class="nav nav-tabs"> <span class="pull-right small text-muted totalCount"></span>

                        </ul>
                        <div class="tab-content">
                            <div class="table-responsive">
                                <div class="spiner-loading">
                                    <div class="sk-spinner sk-spinner-three-bounce">
                                        <div class="sk-bounce1"></div>
                                        <div class="sk-bounce2"></div>
                                        <div class="sk-bounce3"></div>
                                    </div>
                                </div>
                                <table class="table table-striped table-hover" style="margin-bottom: 0px;">
                                    <thead>
                                        <tr>
                                            <th>用户名</th>
                                            <th>用户组</th>
                                            <th>手机号</th>
                                            <th>邮箱</th>
                                            <th>激活状态</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>

                                    </tbody>
                                    <tfoot class="hide-if-no-paging">
                                        <tr>
                                            <td colspan="5" class="text-center footable-visible">
                                                <div class="M-box"></div>
                                            </td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/assets/js/plugins/pagination/jquery.pagination.min.js"></script>
<script src="/assets/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="/assets/js/renderlayer.js"></script>
<script src="/assets/js/users.js"></script>
<script src="/assets/js/content.js?v=4.1.0"></script>
<script type="text/javascript" charset="utf-8">
    $(function(){
        if($("input[name='nogroup']").length>0){
            swal({
                    title: "无可用权限组",
                    text: "请添加用户权限组",
                    type: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "去添加权限组",
                    cancelButtonText: "稍后添加",
                    closeOnConfirm: false,
                    closeOnCancel: true
                },
                function(isConfirm){
                    if (isConfirm) {
                        window.location.href="/group/info";
                    }
                });
        }
    });

    ajaxUser({page:1},1);
</script>